var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, r) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var r in t)
              Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
          })(t, r);
      };
      return function (t, r) {
        function i() {
          this.constructor = t;
        }
        if ("function" != typeof r && null !== r)
          throw new TypeError(
            "Class extends value " + String(r) + " is not a constructor or null"
          );
        e(t, r),
          (t.prototype =
            null === r
              ? Object.create(r)
              : ((i.prototype = r.prototype), new i()));
      };
    })(),
  VipSelectWearDialog = (function (e) {
    function t() {
      var t = e.call(this) || this;
      return (
        (t.onLoadVipSelectDataFn = {
          caller: t,
          code: 6103,
          method: function (e) {
            if (0 == e.code) {
              (t.selWearArr = e.list),
                t.selWearArr.length > 0 && (t.list_select_VIPwear.visible = !0);
              var r;
              t.dataSource = [];
              for (var i = 0; i < t.selWearArr.length; i++)
                (r = {
                  label_vipwear_title: { text: t.selWearArr[i].name },
                  button_vipwear_lingqu: { label: "领取" },
                }),
                  t.dataSource.push(r);
              t.list_select_VIPwear.dataSource = t.dataSource;
            }
          },
        }),
        (t.onLoadVIPResultData = {
          caller: t,
          code: 6154,
          method: function (e) {
            ToastView.toastView(e.data),
              WebSocketService.send({ c: 6102, d: { lvl: -2 } });
          },
        }),
        WebSocketService.addListener(t.onLoadVipSelectDataFn),
        WebSocketService.addListener(t.onLoadVIPResultData),
        (t.list_select_VIPwear.selectEnable = !0),
        (t.list_select_VIPwear.vScrollBarSkin = ""),
        t.list_select_VIPwear.on(Laya.Event.CLICK, t, t.onVipDengJiDidClickFn),
        t.btn_vipWear_close.on(Laya.Event.CLICK, t, t.onVIPWearClose),
        t
      );
    }
    return (
      __extends(t, e),
      (t.showVipSelectWearDialog = function (e) {
        null == this.vipselWear &&
          ((this.vipselWear = new t()), (this.vipselWear.zOrder = 1e3)),
          this.vipselWear.popup(!0),
          (this.vipselWear.pid = e),
          parseInt(e) > 0
            ? WebSocketService.send({ c: 6103, d: { pid: e } })
            : WebSocketService.send({ c: 6103, d: { pid: 1 } });
      }),
      (t.prototype.onVipDengJiDidClickFn = function (e) {
        if ("" != e.target.name && "button_vipwear_lingqu" == e.target.name) {
          var t = this.selWearArr[this.list_select_VIPwear.selectedIndex].id;
          WebSocketService.send({ c: 6154, d: { pid: this.pid, npcid: t } });
        }
      }),
      (t.prototype.onVIPWearClose = function () {
        this.close();
      }),
      (t.close = function () {
        this.vipselWear && (this.vipselWear.close(), (this.vipselWear = null));
      }),
      t
    );
  })(ui.VIPManagerController.VipSelectWearDialogUI);
